package com.vishu.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class EmainValidation {
	
	public static void main(String args[])
	{
	Pattern pat=Pattern.compile("^[a-zA-Z0-9]+([._][a-zA-Z0-9])*(@)[a-zA-Z]+(.)(com|co.in|in)$");  
	
	Matcher mat=pat.matcher("And.p@gmail.com");
	
	if(mat.matches())System.out.println("Matches");
    else System.out.println("Doesn't Match");
	
		
	
	
	}

}
